/* demo.js */

require.css( './demo.css' );

var $ = dfish,
	demo = {
		checkPwd : function(target,isSave){
			var vm =$.vm(target);
			var password = vm.fv('password');
			var cfmPassword = vm.fv('cfmPassword');
			var snapType = 'tb';
			if(password != cfmPassword){
				vm.cmd({type:'tip',prong :true, id:'tip_'+cfmPassword, snap:vm.f('cfmPassword'), text:'前后两次密码输入不一致', snaptype:snapType });
				return;
			} else {
				var tip = vm.find('tip_'+cfmPassword);
				if(tip){
					tip.close();
				}
				if(isSave){
					vm.cmd('save');
				}
			}
		}
};

// 导出模块
module.exports = demo;